#include <ncurses.h>

int main()
{
  int key = 0;
  initscr();
  noecho();
  keypad(stdscr, TRUE);
  key = getch();
  while(key != '$')
  {
    printw("%d\n", key);
    key = getch();
    refresh();
  }
  endwin();
}
